package cn.qingyun.gis.modules.express.util;

import cn.hutool.core.util.StrUtil;
import cn.qingyun.gis.exception.CommonException;

import javax.servlet.http.HttpServletRequest;

public class SsoTool {
    public static void validRequestFromMobile(HttpServletRequest request) {
        String userAgent = request.getHeader("User-Agent");

        if (!(StrUtil.isNotBlank(userAgent) && userAgent.contains("Mobile"))) {
            throw new CommonException("非法的请求来源，请在网格通应用登录");
        }
    }
}
